home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / rkpls301.zip / RKPDEMO3.ZIP / BRAND.PAS next >
Pascal/Delphi Source File  |  1993-03-04  |  2KB  |  76 lines

  1. Program Brand;
  2.  
  3. {
  4.  This is a sample program using RkPlus.  It is a sample of a software
  5.  branding programme that would be used by the user to enter their name
  6.  and registration key and modify the EXE file.  This sample will brand
  7.  the Sample4 programme, using a registration key which would be generated
  8.  by the programmer using the GenKey program.
  9.  
  10.  Brand uses the Rkp3Enc unit to cause RkPlus to use the new version 3.x
  11.  keys.
  12. }
  13.  
  14.  
  15. Uses
  16.   Crt,
  17.   RkPlus,
  18.   Rkp3Enc;
  19.  
  20.  
  21. Const
  22.   MonthNames : Array[1..12] of String[3]
  23.   = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  24.  
  25.  
  26. Var
  27.   kc    : Char;
  28.   Owner : Array[0..16] of Char;
  29.   Prog  : Array[0..5] of Char;
  30.   Ver   : Real;
  31.  
  32.  
  33. Begin
  34.   Owner := 'ArgleBarbWotsLeeb';
  35.   Prog := 'Sample';
  36.   Ver := 1.0;
  37.   SetOwnerCode(Owner,SizeOf(Owner));
  38.   SetProgCode(Prog,SizeOf(Prog));
  39.   SetVerCode(Ver,SizeOf(Ver));
  40.   SetKeyFile('Sample4');
  41.   WriteLn('Brand');
  42.   WriteLn('Software Branding Programme for Sample4');
  43.   WriteLn('See RKPLUS.DOC for more info');
  44.   WriteLn;
  45.   Write('Enter name of person to register : ');
  46.   ReadLn(Rkp.Name1);
  47.   WriteLn;
  48.   Write('Enter the registration key : ');
  49.   ReadLn(Rkp.Key);
  50.   WriteLn;
  51.   Rkp.ID := '(c) Serious Cybernetics';
  52.   Rkp.Message := 'Brand';
  53.   Rkp.Name2 := '';
  54.   Rkp.Name3 := '';
  55.   Rkp.Level := 0;
  56.   VerifyKey;
  57.   If Not Rkp.Registered then Begin
  58.     Rkp.Level := 1;
  59.     VerifyKey;
  60.   End;
  61.   If Not Rkp.Registered then
  62.     WriteLn('Invalid key!')
  63.   Else Begin
  64.     Write('Branding ',ExeFileName,'...');
  65.     BrandRegInfo;
  66.     WriteLn;
  67.     WriteLn;
  68.     If RkpOK then
  69.       WriteLn(ExeFileName,' branded.')
  70.     Else If (RkpError = InvalidFile) then
  71.       WriteLn(ExeFileName,' is not a valid RkPlus file!')
  72.     Else
  73.       WriteLn('Error ',RkpError,' branding ',ExeFileName,'.');
  74.   End;
  75. End.
  76.